package com.lzq.course.gateway;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * spring boot 自己的网关组件 gateway
 * 网关主要功能：限流（流量控制）；重试（请求失败时重试，慎用)：跨域（前后端不在同一个域）；路由转发请求；鉴权（登录校验，签名校验）
 */
@SpringBootApplication
@EnableEurekaClient
public class GatewayApplication {

    private final static Logger LOG = LoggerFactory.getLogger(GatewayApplication.class);

    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(GatewayApplication.class);
        ConfigurableEnvironment env = app.run(args).getEnvironment();
        LOG.info("启动成功！！");
        LOG.info("Gateway地址：\thttp:127.0.0.1:{}", env.getProperty("server.port"));
    }
}
